<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Including Patterns (GNU Compiler Collection (GCC) Internals)</title>

<meta name="description" content="Including Patterns (GNU Compiler Collection (GCC) Internals)">
<meta name="keywords" content="Including Patterns (GNU Compiler Collection (GCC) Internals)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Option-Index.html" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Machine-Desc.html" rel="up" title="Machine Desc">
<link href="Peephole-Definitions.html" rel="next" title="Peephole Definitions">
<link href="Insn-Splitting.html" rel="prev" title="Insn Splitting">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en">
<div class="section-level-extent" id="Including-Patterns">
<div class="nav-panel">
<p>
Next: <a href="Peephole-Definitions.html" accesskey="n" rel="next">Machine-Specific Peephole Optimizers</a>, Previous: <a href="Insn-Splitting.html" accesskey="p" rel="prev">Defining How to Split Instructions</a>, Up: <a href="Machine-Desc.html" accesskey="u" rel="up">Machine Descriptions</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h3 class="section" id="Including-Patterns-in-Machine-Descriptions_002e"><span>17.17 Including Patterns in Machine Descriptions.<a class="copiable-link" href="#Including-Patterns-in-Machine-Descriptions_002e"> &para;</a></span></h3>
<a class="index-entry-id" id="index-insn-includes"></a>

<a class="index-entry-id" id="index-include"></a>
<p>The <code class="code">include</code> pattern tells the compiler tools where to
look for patterns that are in files other than in the file
<samp class="file">.md</samp>.  This is used only at build time and there is no preprocessing allowed.
</p>
<p>It looks like:
</p>
<div class="example smallexample">
<pre class="example-preformatted">

(include <var class="var">pathname</var>)
</pre></div>

<p>For example:
</p>
<div class="example smallexample">
<pre class="example-preformatted">

(include &quot;filestuff&quot;)

</pre></div>

<p>Where <var class="var">pathname</var> is a string that specifies the location of the file,
specifies the include file to be in <samp class="file">gcc/config/target/filestuff</samp>.  The
directory <samp class="file">gcc/config/target</samp> is regarded as the default directory.
</p>

<p>Machine descriptions may be split up into smaller more manageable subsections
and placed into subdirectories.
</p>
<p>By specifying:
</p>
<div class="example smallexample">
<pre class="example-preformatted">

(include &quot;BOGUS/filestuff&quot;)

</pre></div>

<p>the include file is specified to be in <samp class="file">gcc/config/<var class="var">target</var>/BOGUS/filestuff</samp>.
</p>
<p>Specifying an absolute path for the include file such as;
</p><div class="example smallexample">
<pre class="example-preformatted">

(include &quot;/u2/BOGUS/filestuff&quot;)

</pre></div>
<p>is permitted but is not encouraged.
</p>
<ul class="mini-toc">
<li><a href="#RTL-Generation-Tool-Options-for-Directory-Search" accesskey="1">RTL Generation Tool Options for Directory Search</a></li>
</ul>
<div class="subsection-level-extent" id="RTL-Generation-Tool-Options-for-Directory-Search">
<h4 class="subsection"><span>17.17.1 RTL Generation Tool Options for Directory Search<a class="copiable-link" href="#RTL-Generation-Tool-Options-for-Directory-Search"> &para;</a></span></h4>
<a class="index-entry-id" id="index-directory-options-_002emd"></a>
<a class="index-entry-id" id="index-options_002c-directory-search"></a>
<a class="index-entry-id" id="index-search-options"></a>

<p>The <samp class="option">-I<var class="var">dir</var></samp> option specifies directories to search for machine descriptions.
For example:
</p>
<div class="example smallexample">
<pre class="example-preformatted">

genrecog -I/p1/abc/proc1 -I/p2/abcd/pro2 target.md

</pre></div>


<p>Add the directory <var class="var">dir</var> to the head of the list of directories to be
searched for header files.  This can be used to override a system machine definition
file, substituting your own version, since these directories are
searched before the default machine description file directories.  If you use more than
one <samp class="option">-I</samp> option, the directories are scanned in left-to-right
order; the standard default directory come after.
</p>

</div>
</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Peephole-Definitions.html">Machine-Specific Peephole Optimizers</a>, Previous: <a href="Insn-Splitting.html">Defining How to Split Instructions</a>, Up: <a href="Machine-Desc.html">Machine Descriptions</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
